<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="销售回款一览表" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<link href="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/css/BillList.css" />
<script src="/js/QueryList.js"></script>
<script src="/js/popup_ext.js"></script>
<script src="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<script language="javascript">
	function doShow(id,type){
		var url;
		var h;
		if(type=="IMPREST"){
			h=600;
			url="/business/BusinessBillEdit.ihtm?id="+id;
		}else{
			h=500;
			url="/finance/ReceiveBillEdit.ihtm?id="+id;
		}
		ShowIframe("查看",url,1024,h,"refreshWin();",1024,600);
	}
	function refreshWin(){
		if(popRetVal!=null){
			window.location.reload(true);
		}
	}
	function checkDateStr(){
		var startDate=document.getElementById("start_date").value;
		if(startDate==null || startDate==''){
			ShowAlert('提示框','请选择开始日期',200,100);
			return false;
		}else{
			var arr=startDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','开始日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','开始日期格式不正确',200,100);
				return false;
			}
		}
		var endDate=document.getElementById("end_date").value;
		if(endDate==null || endDate==''){
			ShowAlert('提示框','请选择结束日期',200,100);
			return false;
		}else{
			var arr=endDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','结束日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','结束日期格式不正确',200,100);
				return false;
			}
		}
		return true;
	}
	function createPageParaStr(){
		var str="start_date="+encodeURIComponent(document.getElementById("start_date").value);
		str=str+"&end_date="+encodeURIComponent(document.getElementById("end_date").value);
		str=str+"&manager_name="+encodeURIComponent(document.getElementById("manager_name").value);
		str=str+"&creater_name="+encodeURIComponent(document.getElementById("creater_name").value);
		str=str+"&est_name="+encodeURIComponent(document.getElementById("est_name").value);
		str=str+"&est_id="+document.getElementById("est_id").value;
		str=str+"&department="+document.getElementById("department").value;
		str=str+"&min_cost="+encodeURIComponent(document.getElementById("min_cost").value.trim());
		str=str+"&max_cost="+encodeURIComponent(document.getElementById("max_cost").value.trim());
		str=str+"&ban_acc="+document.getElementById("ban_acc").value;
		str=str+"&ts_id="+document.getElementById("ts_id").value;
		
		var backType="A";
		if(document.getElementById("back_type1").checked){
			backType="IMPREST";
		}else if(document.getElementById("back_type2").checked){
			backType="RECEIVE";
		}
		str=str+"&back_type="+backType;
		
		return str;
	}
	
	function createProgramParaStr(){
		var str="start_date="+encodeURIComponent(document.getElementById("hid_start_date").value);
		str=str+"&end_date="+encodeURIComponent(document.getElementById("hid_end_date").value);
		str=str+"&manager_name="+encodeURIComponent(document.getElementById("hid_manager_name").value);
		str=str+"&creater_name="+encodeURIComponent(document.getElementById("hid_creater_name").value);
		str=str+"&est_name="+encodeURIComponent(document.getElementById("hid_est_name").value);
		str=str+"&est_id=${estId}";
		str=str+"&department=${department}";
		str=str+"&min_cost="+encodeURIComponent(document.getElementById("hid_min_cost").value);
		str=str+"&max_cost="+encodeURIComponent(document.getElementById("hid_max_cost").value);
		str=str+"&ban_acc=${banAcc}";
		str=str+"&ts_id=${tsId}";
		str=str+"&back_type=${backType}";
		return str;
	}
	function doSearch(){
		var str;
		if(IsAdvSearch){//高级
			str="search_type=1";
			if(document.getElementById("cb_back_date").checked){
				if(checkDateStr()){
					str=str+"&cb_back_date=1";
				}else{
					return;
				}
			}
			if(document.getElementById("cb_manager").checked){
				var managerName=document.getElementById("manager_name").value.trim();
				if(managerName==null || managerName==""){
					ShowAlert('提示框','请输入经办人姓名',200,100);
					return;
				}
				str=str+"&cb_manager=1";
			}
			if(document.getElementById("cb_creater").checked){
				var createrName=document.getElementById("creater_name").value.trim();
				if(createrName==null || createrName==""){
					ShowAlert('提示框','请输入开单人姓名',200,100);
					return;
				}
				str=str+"&cb_creater=1";
			}
			if(document.getElementById("cb_est").checked){
				var estId=document.getElementById("est_id").value.trim();
				if(estId==null || estId=="" || estId=="0"){
					ShowAlert('提示框','请输入付款单位',200,100);
					return;
				}
				str=str+"&cb_est=1";
			}
			
			if(document.getElementById("cb_dep").checked){
				var department=document.getElementById("department").value;
				if(department==null || department=="" || department=="0"){
					ShowAlert('提示框','请选择部门',200,100);
					return;
				}
				str=str+"&cb_dep=1";
			}
			if(document.getElementById("cb_cost").checked){
				var minCost=document.getElementById("min_cost").value.trim();
				if(minCost==null || minCost==""){
					ShowAlert('提示框','请输入最小金额',200,100);
					return;
				}else if(isNaN(minCost)){
					ShowAlert('提示框','最小金额只能是数字',200,100);
					return;
				}
				var maxCost=document.getElementById("max_cost").value.trim();
				if(maxCost==null || maxCost==""){
					ShowAlert('提示框','请输入最大金额',200,100);
					return;
				}else if(isNaN(maxCost)){
					ShowAlert('提示框','最大金额只能是数字',200,100);
					return;
				}
				str=str+"&cb_cost=1";
			}
			if(document.getElementById("cb_ban").checked){
				var banAcc=document.getElementById("ban_acc").value;
				if(banAcc==null || banAcc=="" || banAcc=="0"){
					ShowAlert('提示框','请选择银行账户',200,100);
					return;
				}
				str=str+"&cb_ban=1";
			}
			if(document.getElementById("cb_ts").checked){
				var tsId=document.getElementById("ts_id").value;
				if(tsId==null || tsId=="" || tsId=="0"){
					ShowAlert('提示框','请选择帐套',200,100);
					return;
				}
				str=str+"&cb_ts=1";
			}
			if(document.getElementById("cb_back_type").checked){
				str=str+"&cb_back_type=1";
			}
		}else{//快速
			str="search_type=2";
			if(!checkDateStr()){
				return;
			}
		}
		var paraStr=createPageParaStr();
		if(paraStr!=""){
			str=str+"&"+paraStr;
		}
		window.location="/finance/BackCostList.ihtm?"+str;
	}

	function getSearchCondition(){
		var searchType="${searchType}";
		var str="search_type="+searchType;
		if(searchType=="1"){//高级
			<c:if test="${cbBackDate=='1'}">str=str+"&cb_back_date=1";</c:if>
			<c:if test="${cbManager=='1'}">str=str+"&cb_manager=1";</c:if>
			<c:if test="${cbCreater=='1'}">str=str+"&cb_creater=1";</c:if>
			<c:if test="${cbEst=='1'}">str=str+"&cb_est=1";</c:if>
			<c:if test="${cbDep=='1'}">str=str+"&cb_dep=1";</c:if>
			<c:if test="${cbCost=='1'}">str=str+"&cb_cost=1";</c:if>
			<c:if test="${cbBan=='1'}">str=str+"&cb_ban=1";</c:if>
			<c:if test="${cbTs=='1'}">str=str+"&cb_ts=1";</c:if>
			<c:if test="${cbBackType=='1'}">str=str+"&cb_back_type=1";</c:if>
		}else{//快速
			
		}
		var paraStr=createProgramParaStr();
		if(paraStr!=""){
			str=str+"&"+paraStr;
		}
		return str;
	}
	function doDownload(){
		var str=getSearchCondition();
		window.location="/finance/BackCostList.ihtm?content_type=EXCEL&"+str;
	}
	
	function checkInput(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
	function doAutoCheck(objId){
		document.getElementById(objId).checked=true;
	}
	function doPrint(){
		var str=getSearchCondition();
		showWin(900,600,"/finance/BackCostList.ihtm?content_type=PRINT&"+str);
	}
	function selectStafferName(objId,checkObjId){
		var url="/base/StafferMainForSelect.ihtm";
		var cb="selectStafferNameCallBack('"+objId+"','"+checkObjId+"')";
		ShowIframe("选择员工",url,800,500,cb);
	}
	function selectStafferNameCallBack(objId,checkObjId){
		if(popRetVal!=null){
			var arr=popRetVal.split(";");
			document.getElementById(objId).value=arr[1];
			doAutoCheck(checkObjId);
		}
	}
	function selectEst(){
		var url="/base/EstablishmentListForSelect.ihtm?type=CLIENT";
		ShowIframe("选择客户",url,900,500,"selectEstCallBack()",900,600);
	}
	function selectEstCallBack(){
		if(popRetVal!=null){
			document.getElementById("est_id").value=popRetVal[0];
			document.getElementById("est_name").value=popRetVal[1];
			doAutoCheck("cb_est");
		}
	}
	function setDate(type){
		var d=new Date();
		var startStr="";
		var endStr="";
		if(type=="CURRENT_MONTH"){
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-01";
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="PREVIEW_MONTH"){
			d=new Date(d.getFullYear(),d.getMonth(),1);
			d.setDate(d.getDate()-1);
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-1";
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="TODAY"){
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="YESTERDAY"){
			d.setDate(d.getDate()-1);
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}
		document.getElementById("start_date").value=startStr;
		document.getElementById("end_date").value=endStr;
		doAutoCheck("cb_back_date");
	}
</script>
</head>
<body oncontextmenu="return false">
<div class="Wrap"><!-- 页面主框架 -->
    
	<div id="ListContainer" class="Container"><!-- 主体容器 -->
	    
	    <!-- 标题栏 -->
	    <div class="Heading BillIcon">
	        <div class="HeadingContent">
	            <h1>销售回款一览表</h1>
	            <span class="Note">查询指定期间预付款与客户结欠回款明细</span>
	        </div>
	    </div>
	
		<!-- 主内容 -->
		<div class="Content">
	        <!-- 筛选控件栏 -->
	        <div class="FilterBar ClearFix">
	            <div class="SearchIcon"></div>
	            <span class="fl">
	            	<table class="MoreOption" cellpadding="0" cellspacing="0">
	            		<th class="c1" width="80px">
	            			<input type="checkbox" name="cb_back_date" id="cb_back_date" <c:if test="${cbBackDate=='1' || searchType=='2'}">checked="true"</c:if> style="visibility:hidden;" />
	            			回款日期
	            		</th>
	            		<td width="360px">
	            			<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_back_date');" id="start_date" name="start_date" value="<c:out value="${startDate}" />">
			            	<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('start_date'),'yyyy-mm-dd',this,false,'doAutoCheck(\'cb_back_date\')');">
			            	<input type="hidden" id="hid_start_date" value="<c:out value="${startDate}" />">
			            	至
			            	<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_back_date');" id="end_date" name="end_date" value="<c:out value="${endDate}" />">
			            	<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('end_date'),'yyyy-mm-dd',this,false,'doAutoCheck(\'cb_back_date\')');">
			            	<input type="hidden" id="hid_end_date" value="<c:out value="${endDate}" />">
			            	<a href="javascript:setDate('CURRENT_MONTH');">本月</a>
							<a href="javascript:setDate('TODAY');">今天</a>
							<a href="javascript:setDate('YESTERDAY');">昨天</a>
							<a href="javascript:setDate('PREVIEW_MONTH');">上月</a>
	            		</td>
	            	</table>
	            </span>
	            <span class="fr">
	            	<a href="javascript:;" id="lnkMoreOption">更多查询选项</a>
		  			<input type="button" value=" 查 询" onClick="doSearch();" class="buttom search-but" id="sSearchButton" name="sSearchButton">
					<input type="button" value=" 导 出" onClick="doDownload();" class="buttom search-out" id="sDownloadButton" name="sDownloadButton" <c:if test="${currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';NO_EXPO;')!=-1}">disabled="true"</c:if>>
					<input type="button" value=" 打 印" onClick="doPrint();" class="buttom search-print" id="sPrintButton" name="sPrintButton">
	            </span>
				<div id="dvMoreOptionBox" class="MoreOptionBox" style="display:none;">
					<table class="MoreOption" cellpadding="0" cellspacing="0">
						<tr>
							<th class="c1" width="80px">
			        			<input type="checkbox" name="cb_est" id="cb_est" <c:if test="${cbEst=='1'}">checked="true"</c:if>>
			        			付款单位
			        		</th>
			        		<td class="c1" width="260px">
			        			<input type="text" class="TextBox readonly" readonly="true" maxlength="50" name="est_name" id="est_name" onFocus="doAutoCheck('cb_est');" value="<c:out value="${estName}" />" >
								<img class="imgIconButton" src="/images/make-a.gif" onClick="selectEst();" />
								<input type="hidden" name="est_id" id="est_id" value="${estId}">
								<input type="hidden" id="hid_est_name" value="<c:out value="${estName}" />">
			    			</td>
			    			<th class="c2" width="80px">
	                        	<input type="checkbox" name="cb_back_type" id="cb_back_type" <c:if test="${cbBackType=='1'}">checked="true"</c:if>>
	                        	回款类型
	                        </th>
	                        <td class="c2" width="250px">
	                        	<input type="radio" name="back_type" id="back_type1" onClick="doAutoCheck('cb_back_type');" <c:if test="${backType=='IMPREST'}">checked="true"</c:if>>预付
								<input type="radio" name="back_type" id="back_type2" onClick="doAutoCheck('cb_back_type');" <c:if test="${backType=='RECEIVE'}">checked="true"</c:if>>结欠
								<input type="radio" name="back_type" id="back_type3" onClick="doAutoCheck('cb_back_type');" <c:if test="${backType==null || backType=='' || backType=='A'}">checked="true"</c:if>>全部
	                    	</td>
	                    </tr>
	                    <tr>
	                    	<th class="c1">
			        			<input type="checkbox" name="cb_cost" id="cb_cost" <c:if test="${cbCost=='1'}">checked="true"</c:if>>
			        			付款金额
			        		</th>
			    			<td>
			        			<input type="text" class="TextBox Money" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_cost');" id="min_cost" name="min_cost" value="${minCost}">
								至
								<input type="text" class="TextBox Money" maxlength="15" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_cost');" id="max_cost" name="max_cost" value="${maxCost}">
								<input type="hidden" id="hid_min_cost" value="<c:out value="${minCost}" />">
								<input type="hidden" id="hid_max_cost" value="<c:out value="${maxCost}" />">
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_manager" id="cb_manager" <c:if test="${cbManager=='1'}">checked="true"</c:if>>
			        			经办人
			        		</th>
			        		<td class="c3">
			        			<input type="text" class="TextBox" maxlength="15" name="manager_name" id="manager_name" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_manager');" value="<c:out value="${managerName}" />">
								<img class="imgIconButton" src="/images/make-a.gif" onClick="selectStafferName('manager_name','cb_manager');" />
								<input type="hidden" id="hid_manager_name" value="<c:out value="${managerName}" />">
			    			</td>
	                    </tr>
	                    <tr>
	                    	<th class="c1">
			        			<input type="checkbox" name="cb_ban" id="cb_ban" <c:if test="${cbBan=='1'}">checked="true"</c:if>>
			        			银行账户
			        		</th>
			    			<td class="c1">
			        			<select name="ban_acc" id="ban_acc" onFocus="doAutoCheck('cb_ban');">
					  				<option value="0">==请选择==</option>
					  				<c:forEach var="item" items="${myBaList}">
					  				<option value="${item.id}" <c:if test="${banAcc==item.id}">selected</c:if>>${item.bankName}<c:if test="${item.accountName!=null && item.accountName!=''}">(${item.accountName})</c:if></option>
					  				</c:forEach>
				  				</select>
			    			</td>
			    			<th class="c2">
			        			<input type="checkbox" name="cb_creater" id="cb_creater" <c:if test="${cbCreater=='1'}">checked="true"</c:if>>
			        			开单人
			        		</th>
			        		<td class="c3">
			        			<input type="text" class="TextBox" maxlength="15" name="creater_name" id="creater_name" onKeyUp="checkInput();" onFocus="doAutoCheck('cb_creater');" value="<c:out value="${createrName}" />">
								<img class="imgIconButton" src="/images/make-a.gif" onClick="selectStafferName('creater_name','cb_creater');" style="cursor:pointer;" />
								<input type="hidden" id="hid_creater_name" value="<c:out value="${createrName}" />">
			    			</td>
			    		</tr>
			    		<tr>
			    			<th class="c1">
			        			<input type="checkbox" name="cb_ts" id="cb_ts" <c:if test="${cbTs=='1'}">checked="true"</c:if>>
	                        	账套
			        		</th>
			    			<td class="c1">
			        			<select name="ts_id" id="ts_id" onFocus="doAutoCheck('cb_ts');">
				    				<option value="0">==请选择账套==</option>
				    				<c:forEach var="item" items="${tsList}">
									<option value="${item.id}" <c:if test="${tsId==item.id}">selected</c:if>>${item.title}</option></c:forEach>
								</select>
			        		</td>
			        		<th class="c2">
			        			<input type="checkbox" name="cb_dep" id="cb_dep" <c:if test="${cbDep=='1'}">checked="true"</c:if>>
			        			部门
			        		</th>
			    			<td class="c3">
			        			<select name="department" id="department" onFocus="doAutoCheck('cb_dep');">
					  				<option value="0">==请选择==</option>
					  				<commonTag:createSelectTree list="${departmentList}" emptyOption="0" defaultValue="${department}" />
				  				</select>
			    			</td>
			    		</tr>
					</table>
			    	
			    	<div class="OptionOrderBy">
	                    <span class="fr"><a href="javascript:;" id="lnkHiddenOption">隐藏查询选项</a></span>
	                </div>
				</div>
			</div>
			
			<!-- 提示信息显示栏 -->
	        <div class="MsgBar">
	            <%@include file="../inc/AlertMsg.jsp"%>
	        </div>
	        
	        <!-- 上栏 分页、操作等 -->
			<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';NO_TOTA;')==-1}">
	        <div class="TopToolBar">
	            <table class="ListNoteInfo" cellpadding="0" cellspacing="0">
	            	<tr>
	                	<td>
	            			回款合计：${total}元（预付：${imprestTotal}元  结欠：${receiveTotal}元）
	            			数量：${fn:length(imprestList)+fn:length(receiveList)}笔（预付：${fn:length(imprestList)}笔  结欠：${fn:length(receiveList)}笔）
	                	</td>
	            	</tr>
	            </table>
			</div>
			</c:if>

		    <div class="table-list">
		        <table width="100%">
		           	<tr>
					   	<th  width="8%">预付日期</th>
						<th  width="12%">业务单号</th>
						<th  width="14%">付款单位</th>
						<th  width="14%">摘要</th>
						<th  width="14%">银行账户</th>
						<th  width="10%">金额</th>
						<th  width="7%">经办人</th>
						<th  width="7%">开单人</th>
						<th  width="10%">部门</th>
						<th  width="4%">操作</th>
					</tr>
					<c:if test="${fn:length(imprestList)==0}">
					<tr class="query_list_data_tr1">
						<td colspan="10">没有预付数据</td>
					</tr>
					</c:if>
					<c:if test="${fn:length(imprestList)>0}">
					<c:forEach var="item" items="${imprestList}" varStatus="i">
					<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
					<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
					<tr class="${trClass}">
						<td ><fmt:formatDate value="${item[0].businessBill.orderDate}" pattern="yyyy-MM-dd"/></td>
						<td >${item[0].businessBill.billCode}</td>
						<td >${item[1]}<c:if test="${item[0].businessBill.linkman!=null && item[0].businessBill.linkman!=''}">(${item[0].businessBill.linkman})</c:if></td>
						<td >${item[0].businessBill.content}</td>
						<td ><commonTag:showSimpleObjectName list="${bankAccountList}" objectId="${item[0].businessBill.bankAccountId}" /></td>
						<td >${item[0].businessBill.imprest}</td>
						<td >${item[0].businessBill.managerName}</td>
						<td >${item[0].businessBill.createrName}</td>
						<td >${item[0].departmentName}</td>
						<td>
							<a href="javascript:doShow('${item[0].businessBill.id}','IMPREST');">查看</a>
						</td>
					</tr>
					</c:forEach>
					</c:if>
				</table>
	   		</div>
	   		<br>
	     	<div class="table-list">
		        <table width="100%">
		          	<tr>
					  	<th  width="8%">回款日期</th>
						<th  width="12%">收款单号</th>
						<th  width="14%">付款单位</th>
						<th  width="14%">摘要</th>
						<th  width="14%">银行账户</th>
						<th  width="10%">金额</th>
						<th  width="7%">经办人</th>
						<th  width="7%">开单人</th>
						<th  width="10%">部门</th>		
						<th  width="4%">操作</th>
					</tr>
					<c:if test="${fn:length(receiveList)==0}">
					<tr class="query_list_data_tr1">
						<td colspan="10">没有付款数据</td>
					</tr>
					</c:if>
					<c:if test="${fn:length(receiveList)>0}">
					<c:forEach var="item" items="${receiveList}" varStatus="i">
					<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
					<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
					<tr class="${trClass}">
						<td ><fmt:formatDate value="${item[0].receiveBill.receiveDate}" pattern="yyyy-MM-dd"/></td>
						<td >${item[0].receiveBill.billCode}</td>
						<td >${item[1]}</td>
						<td >${item[0].receiveBill.description}</td>
						<td ><commonTag:showSimpleObjectName list="${bankAccountList}" objectId="${item[0].receiveBill.bankAccountId}" /></td>							
						<td >${item[0].receiveBill.cost}</td>
						<td >${item[0].receiveBill.managerName}</td>
						<td >${item[0].receiveBill.createrName}</td>
						<td >${item[0].departmentName}</td>
						<td>
							<a href="javascript:doShow('${item[0].receiveBill.id}','RECEIVE');">查看</a>
						</td>
					</tr>
					</c:forEach>
					</c:if>
				</table>
     		</div>
			
		</div>
	</div>
</div>
</body>
</html>
<script type="text/javascript">
	function ChangeWindowSize( container, maxWidth ){
	    setTimeout( function(){
	        var w1 = document.documentElement.clientWidth-40;
	        if( w1>maxWidth ) w1 = maxWidth;
	        else if( w1<870 ) w1 = 860;
	        container.style.width = w1+'px';
	    }, 300 );
	}
	var IsAdvSearch = false;
	(function(){
	    var ListContainer = document.getElementById('ListContainer');
	    ChangeWindowSize( ListContainer, 2020 );    // 超过 1280 的最大 1260 ，不全部铺满
	
	    var lnkMoreOption   = document.getElementById('lnkMoreOption');
	    var lnkHiddenOption = document.getElementById('lnkHiddenOption');
	    lnkMoreOption.onclick = function(){
	    	IsAdvSearch = true;
	        document.getElementById('dvMoreOptionBox').style.display = 'block';
	        document.getElementById('cb_back_date').style.visibility = 'visible';
	        this.style.visibility = 'hidden';
	    };
	    lnkHiddenOption.onclick = function(){
	    	IsAdvSearch = false;
	        document.getElementById('dvMoreOptionBox').style.display = 'none';
	        document.getElementById('cb_back_date').style.visibility = 'hidden';
	        lnkMoreOption.style.visibility = 'visible';
	    };
	})();
</script>
